#include <iostream>
#include <vector>
#include <cstdio> 

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int >  vec;
typedef pair < int , int > pii;

int read() {
  int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
  while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 5010;
const int mod = 998244353;

int f[N][N],lim,n,tmp[N],mxd[N];
vec G[N];

int upd(int x) { return x + (x >> 31 & mod); }

void dfs(int x,int p) {
    f[x][0] = 1;
    for(auto y : G[x])
	if(y ^ p) {
	    dfs(y,x);
	    for(int i = 0;i <= min(max(mxd[x],mxd[y] + 1),lim);i++) tmp[i] = 0;
	    for(int i = 0;i <= min(mxd[x],lim);i++)
		for(int j = 0;j <= min(mxd[y],lim);j++) {
		    tmp[i] = upd(tmp[i] + (ll) f[x][i] * f[y][j] % mod - mod);
		    if(i + j + 1 > lim) continue;
		    tmp[max(i,j + 1)] = upd(tmp[max(i,j + 1)] + (ll) f[x][i] * f[y][j] % mod - mod);
		}
	    mxd[x] = max(mxd[x],mxd[y] + 1);
	    for(int i = 0;i <= min(mxd[x],lim);i++) f[x][i] = tmp[i];
	}
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in,lim = in; for(int i = 1,u,v;i < n;i++) u = in,v = in,G[u].pb(v),G[v].pb(u);
    dfs(1,0); int ans = 0; for(int i = 0;i <= min(mxd[1],lim);i++) ans = upd(ans + f[1][i] - mod); printf("%d\n",ans);
    return 0;
} 
